import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/login.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: '登录',
    component: Login,
  },
  // 首页
  {
    path: '',
    component: () => import('../views/layout/index.vue'),
    children: [
      {
        path: '/home',
        name: '首页',
        component: () => import('../views/page/home/index.vue')
      },
    ]
  },
  // 设施管理
  {
    path: '/facilityM',
    component: () => import('../views/layout/index.vue'),
    children: [
      {
        path: '/facilityM/facility',
        name: '设施管理',
        component: () => import('../views/page/facilityM/facility/index.vue')
      },
      {
        path: '/facilityM/type',
        name: '设施分类',
        component: () => import('../views/page/facilityM/type/index.vue')
      },
      {
        path: '/facilityM/part',
        name: '部位类型',
        component: () => import('../views/page/facilityM/part/index.vue')
      },
      {
        path: '/facilityM/assembly',
        name: '部件类型',
        component: () => import('../views/page/facilityM/assembly/index.vue')
      },
      {
        path: '/facilityM/construct',
        name: '构件类型',
        component: () => import('../views/page/facilityM/construct/index.vue')
      },
    ]
  },
  // 项目管理
  {
    path: '/projectM',
    component: () => import('../views/layout/index.vue'),
    children: [
      {
        path: '/projectM/maintenance',
        name: '养护项目',
        component: () => import('../views/page/projectM/maintenance/index.vue')
      },
      {
        path: '/projectM/patrol',
        name: '巡查项目',
        component: () => import('../views/page/projectM/patrol/index.vue')
      },
      {
        path: '/projectM/engineering',
        name: '工程项目',
        component: () => import('../views/page/projectM/engineering/index.vue')
      },
      {
        path: '/projectM/detection',
        name: '检测项目',
        component: () => import('../views/page/projectM/detection/index.vue')
      },
      {
        path: '/projectM/monitor',
        name: '监测项目',
        component: () => import('../views/page/projectM/monitor/index.vue')
      },
    ]
  },
  // 巡查管理
  {
    path: '/patrolM',
    component: () => import('../views/layout/index.vue'),
    children: [
      {
        path: '/patrolM/spot',
        name: '设施巡查点',
        component: () => import('../views/page/patrolM/spot/index.vue')
      },
      {
        path: '/patrolM/plan',
        name: '巡查计划',
        component: () => import('../views/page/patrolM/plan/index.vue')
      },
      {
        path: '/patrolM/work',
        name: '巡查任务',
        component: () => import('../views/page/patrolM/work/index.vue')
      },
    ]
  },
  // 案卷管理
  {
    path: '/dossierM',
    component: () => import('../views/layout/index.vue'),
    children: [
      {
        path: '/dossierM/dossier',
        name: '案卷管理',
        component: () => import('../views/page/dossierM/dossier/index.vue')
      },
    ]
  },
  // 知识图谱
  {
    path: '/mapping',
    component: () => import('../views/layout/index.vue'),
    children: [
      {
        path: '/mapping/approve',
        name: '审批流程',
        component: () => import('../views/page/mapping/approve/index.vue')
      },
      {
        path: '/mapping/scheme',
        name: '方案标准',
        component: () => import('../views/page/mapping/scheme/index.vue')
      },
      {
        path: '/mapping/disease',
        name: '病害标准',
        component: () => import('../views/page/mapping/disease/index.vue')
      },
      {
        path: '/mapping/field',
        name: '常用字段',
        component: () => import('../views/page/mapping/field/index.vue')
      },
      {
        path: '/mapping/dictionaries',
        name: '字典管理',
        component: () => import('../views/page/mapping/dictionaries/index.vue')
      },
    ]
  },
  // 基础配置
  {
    path: '/basic',
    component: () => import('../views/layout/index.vue'),
    children: [
      {
        path: '/basic/organization',
        name: '组织管理',
        component: () => import('../views/page/basic/organization/index.vue')
      },
      {
        path: '/basic/user',
        name: '用户管理',
        component: () => import('../views/page/basic/user/index.vue')
      },
      {
        path: '/basic/role',
        name: '角色管理',
        component: () => import('../views/page/basic/role/index.vue')
      },
      {
        path: '/basic/deadline',
        name: '系统期限',
        component: () => import('../views/page/basic/deadline/index.vue')
      },
      {
        path: '/basic/menu',
        name: '菜单管理',
        component: () => import('../views/page/basic/menu/index.vue')
      },

    ]
  },










  //基础配置
  // {
  //   path: '/jiChu',
  //   component: () => import('../layout/index.vue'),
  //   children: [
  //     {
  //       path: 'peiZhi',
  //       name: '组织管理',
  //     },
  //     {
  //       path: 'peiZhi/zuZhiGuanLi',
  //       name: '组织管理',
  //       component: () => import('../views/jiChuPeiZhi/zuZhiGuanLi/index.vue')
  //     }, {
  //       path: 'peiZhi/yongHuGuanLi',
  //       name: '用户管理',
  //       component: () => import('../views/jiChuPeiZhi/yongHuGuanLi/index.vue')
  //     },


  //   ]
  // },
]

const router = new VueRouter({
  routes
})

export default router
